package org.colafries.admin.entity.domain.index;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import lombok.experimental.Accessors;
import org.colafries.common.enums.LogicDimensionTypeEnum;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
* 逻辑维度
*
* @author Ann
* @since 2024-06-03
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "t_idx_logic_dimension")
public class LogicDimension implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 维度code
     */
    @TableField("code")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long code;

    /**
     * 维度版本
     */
    @TableField("version")
    private Integer version;

    /**
     * 数据领域code
     */
    @TableField("data_domain_code")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long dataDomainCode;

    /**
     * 逻辑事实表codeList
     */
    @TableField(exist = false)
    private List<Long> logicTableCodes;

    /**
     * 维度类型
     */
    @TableField("dim_type")
    private LogicDimensionTypeEnum dimType;

    /**
     * 英文名
     */
    @TableField("field")
    private String field;

    /**
     * 维度名称
     */
    @TableField("alias")
    private String alias;

    /**
     * 维度描述
     */
    @TableField("description")
    private String description;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * 创建人
     */
    @TableField("create_user")
    private String createUser;

    /**
     * 修改人
     */
    @TableField("update_user")
    private String updateUser;

}
